package entities;

import util.DataVerify;

public class Single extends Artist
{
	private String name;
	private String lname;
	/**
	 * @param name
	 * @param lname
	 */
	public Single(String artistic_name, Long a_id, String name, String lname) {
		super(artistic_name, a_id);
		this.name = name;
		this.lname = lname;
	}
	/**
	 * 
	 */
	public Single() {
	}
	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}
	/**
	 * @return the lname
	 */
	public String getLname() {
		return lname;
	}
	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}
	/**
	 * @param lname the lname to set
	 */
	public void setLname(String lname) {
		this.lname = lname;
	}
	public static Single newInstance(String artistic_name, Long a_id, String name, String lname){
		DataVerify.verifyObject("artistic_name",artistic_name);
		DataVerify.verifyObject("a_id",a_id);
		DataVerify.verifyObject("aname",name);
		DataVerify.verifyObject("alname",lname);
		return new Single(artistic_name, a_id, name, lname);
	}
	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		Single other = (Single) obj;
		if (lname == null) {
			if (other.lname != null)
				return false;
		} else if (!lname.equals(other.lname))
			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		return true;
	}
}
